import 'package:equatable/equatable.dart';
import 'package:mobile_app.core/google_apple_store_purchases/application/models/purchase_failures.dart';

sealed class PurchaseStatus {}

class InitialPurchaseStatus extends Equatable implements PurchaseStatus {
  const InitialPurchaseStatus();

  @override
  List<Object?> get props => [];
}

class PurchaseInProgress extends Equatable implements PurchaseStatus {
  const PurchaseInProgress();

  @override
  List<Object?> get props => [];
}

class PurchaseCancelled extends Equatable implements PurchaseStatus {
  const PurchaseCancelled();

  @override
  List<Object?> get props => [];
}

class PurchaseFailed extends Equatable implements PurchaseStatus {
  const PurchaseFailed({
    required this.failure,
  });

  final PurchaseFailure failure;

  @override
  List<Object?> get props {
    return [
      failure,
    ];
  }
}

class PurchaseCompleted extends Equatable implements PurchaseStatus {
  const PurchaseCompleted({
    required this.purchasedItemEffective,
    required this.premiumAccessStatusActive,
  });

  final bool purchasedItemEffective;
  final bool premiumAccessStatusActive;

  @override
  List<Object?> get props {
    return [
      purchasedItemEffective,
      premiumAccessStatusActive,
    ];
  }
}
